﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebForms/SiteWF.master" AutoEventWireup="true" CodeBehind="RoomTypeView.aspx.cs" Inherits="WaterfrontLodge.WebForms.Shared.RoomTypeView" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<fieldset>
    <legend>Room Types</legend>

                <asp:GridView ID="grdSearchResult" runat ="server" AutoGenerateColumns="False" 
                    AllowSorting ="True" onsorting="grdSearchResult_Sorting" 
        onrowdatabound="grdSearchResult_RowDataBound" >
                    <Columns>

                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:HyperLink ID="hlkEdit" runat="server" Text='Edit' NavigateUrl='<%#"~/WebForms/RoomTypeMgt/RoomTypeAddEdit.aspx?TypeID=" + Eval("TypeCode") %>'/>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:BoundField DataField="Description" HeaderText ="Description" SortExpression ="Description"/>

                        <asp:BoundField DataField="MaxOccupant" HeaderText ="Max Occupant" SortExpression ="MaxOccupant"/>

                        <asp:BoundField DataField="RoomSize" HeaderText ="Room Size" SortExpression ="RoomSize"/>
                       
                        <asp:BoundField DataField="PriceInDollar" HeaderText ="Standard Price (S$)" SortExpression ="StdPrice"/>

                        <asp:BoundField DataField="Remarks" HeaderText ="Remarks" SortExpression ="Remarks"/>

                        <asp:TemplateField HeaderText ="Image">
                            <ItemTemplate>
                                <asp:Image runat="server" ID="imgPicture" ImageUrl = '<%# Eval("ImagePath") %>' Height ="100px" Width ="150px"/>
                            </ItemTemplate>
                        </asp:TemplateField>

                        
                    </Columns>
                </asp:GridView>
        
        <br />

        <%
            if (Page.User.IsInRole("admin"))
            {
        %>
            <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click"  Text="Create New" />
        <%
             }
        %> 

    </fieldset>
</asp:Content>
